Las Reliquias de Tolti Aph

An interactive fiction by Graham Nelson (2005) - the Inform 7 source text

Home page

Contents
Previous
Next

Complete text
Section E(r) - Las cartas de encuentro

[ Aquí poblamos el laberinto. Cuando el jugador entra en una nueva habitación que tiene un espacio abierto, "cartas" son sacadas de la "baraja de encuentros" para ver qué se va ha encontrar allí. Las cartas son en realidad las cosas (monstruos, etc) en si mismas y la baraja es un contenedor - el cual, al igual que las habitaciones Roca Sólida y Terra Incognita, existen en algún tipo de forma metafísica y realmente no se encuentran en el mundo del jugador.

Organizamos estas "cartas" en una baraja porque los monstruos muertos, los artefactos usados y los peligros jugados necesitan ser retornados al fondo de la baraja. No se podría sencillamente sacar cartas de ninguna parte: porque entonces habría la posibilidad de sacar la Flauta Mágica, por ejemplo, justo al siguiente turno de haberla usado.

Aunque poco código de Inform usa o se da cuenta de esto, los contenidos de una habitación o un contenedor están, de hecho, organizados como una lista, así que nosotros usamos esto furtivamente para ordenar la baraja. Nota que "return X to the pack" (retornar X a la baraja), definido más abajo, pone X al fondo eliminando todas las cartas, poniendo dentro X, y luego poniendo todas las cartas de vuelta a la baraja - lo cual suena lento, pero que es un ejercicio trivial para una computadora, y en cualquier caso ocurre relativamente con poca frecuencia en el juego.]

The encounters pack is a container.

Definition: a thing is out-of-the-pack if it is in Terra Incognita.

When play begins:
    let the pack size be the number of out-of-the-pack things;
    let the total shuffled be 0;
    while the total shuffled is less than the pack size
    begin;
        let the next card be a random out-of-the-pack thing;
        move the next card to the encounters pack;
        let the total shuffled be the total shuffled plus 1;
    end while.

To return (this card - a thing) to the pack:
    move this card to Terra Incognita;
    now all things in the encounters pack are in Terra Incognita;
    now all things in Terra Incognita are in the encounters pack.

The previous location is a room that varies. Before going, change the previous location to the location.

After going to an unvisited labyrinth room (called the locale): draw cards for the locale; continue the action.

To draw cards for (locale - a room):
    if the open space part of the shape of the locale is 0, stop;
    let the draw count be the open space part of the shape of the locale plus the maze level part of the grid position of the locale;
    let the preferred artefact be the Mapa Encantado;
    if the current maze task is the hoja malva, let the preferred artefact be the Flauta Encantada;
    if the current maze level is 1 and the preferred artefact is in the encounters pack[1]
    begin;
        move the preferred artefact to the locale;
        stop;
    end if;
    if the current maze task is the hoja verde guisante and the Ojo del Dios is in the encounters pack and the number of unvisited labyrinth rooms is less than 10[2]
    begin;
        move the Ojo del Dios to the locale;
        decrease the draw count by 1;
    end if;
    while the draw count is greater than 1 and something (called the top card) is in the encounters pack
    begin;
        move the top card to the locale;
        if the current maze level is 1[3]
        begin;
            if the top card is a hazard, return the top card to the pack;
            if the top card is a monster and the defensive charm of the top card is exorcizar no-muertos, return the top card to the pack;
        end if;
        if the locale is the Bóveda de los Huesos Blancos and the top card is a hazard, return the top card to the pack;[4]
        if the top card is an artefact and the current maze level is less than the minimum level of the top card, return the top card to the pack;[5]
        if the top card is a monster, now the top card is surprised;
        decrease the draw count by 1;
    end while.


Notes

[1]. Trucamos la baraja para estar seguros de que la primera cosa que encuentre el jugador es un artefacto útil: habitualmente el Mapa, pero en "el rescate de Eurídice" es la Flauta Encantada, ya que dibujamos al jugador como Orfeo.

[2]. En la misión de traer de vuelta el Ojo del Dios, podría ser un poco injusto para el Ojo permanecer en el fondo de la baraja durante todo el juego: así que una vez que cuatro quintos del laberinto han sido jugados, el Ojo del Dios se coloca para aparecer el siguiente.

[3]. El jardín laberíntico no sufre de trampas, terremotos, o la funesta presencia de los no-muertos.

[4]. La Boveda de los Huesos es una caverna inmensa y muy propensa ha sacar muchas cartas, lo cual significa que hay muchas probabilidades de que salga una Trampa o un Terremoto: cuando de hecho ocurría en la fase de testeo, el efecto era poco satisfactorio en primera instancia, injusto en segunda. Así que he hecho que la Boveda de los Huesos esté libre de peligros.

[5]. Por ejemplo, no encontrarás el Anillo dando vueltas por el laberinto jardín.